<template>
  <div>
    <div class="table-operator" v-if="stage !== '05010' && stage !== '05050'">
      <a-button type="primary"
                style='background-color: #FFA500;border:0' @click="OnExportList">
        导出分工
      </a-button>
      <!-- <a-button :disabled="status == '9' || status == '2'"
                v-permission="['20010']"
                type="primary"
                @click="showConfirm">
        提交审核
      </a-button>
      <a-button :disabled="status !== '2'"
                v-permission="['20020']"
                @click="setApproveReason('9')">
        同意
      </a-button>
      <a-button :disabled="status !== '2'"
                v-permission="['20020']"
                type="danger"
                @click="setApproveReason('1')">
        拒绝
      </a-button>
      <a-button @click="showShjl" style="margin-top:10px">审核记录</a-button> -->
    </div>
    <a-table
      ref="table"
      size="middle"
      bordered
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
      <span slot="actionName">
      分配
      </span>
      <span slot="action" slot-scope="text, record">
        <a v-if="stage !== '05010' && stage !== '05050'" @click="handleEdit(record,'分配人员')">重新分配</a>
      </span>
    </a-table>
    <CheckAndEditModel ref="modalForm" :id="id" :type="type" @ok="modalFormOk"></CheckAndEditModel>
    <SelectApprove ref='approver' :id='id' @submitData='handleSubmit'></SelectApprove>
    <SetReason ref='setReason' @approveReason='approveData'></SetReason>
    <shjlModal ref="shjlModal" :id='id' :typeId='typeId' :apiUrl='url.applyLog'></shjlModal>
  </div>
</template>

<script>
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import {butStatus} from '../../public/butStatus'
  import CheckAndEditModel from './CheckAndEditModel'
  import columns from './indexColumns'
  import SelectApprove from '../../public/SelectApprover'
  import SetReason from "../../public/SetReason"
  import shjlModal from "../../shjlModal"

  export default {
    props: ['id', 'type', 'stage'],
    name: "sjfg",
    components: {
      CheckAndEditModel,
      SetReason,
      SelectApprove,
      shjlModal
    },
    mixins: [JeecgListMixin, butStatus],
    data() {
      return {
        queryParam: {
          proId: this.id,
          typeId: this.type,
        },
        typeId: this.type,
        columns: columns(this),
        url: {
          list: '/sjxmzygl/sjWorkZtfaEve/getWorkZtfaEveList',
          // exportList: `${window._CONFIG['domianURL']}/sjxmzygl/sjWorkZtfaEve/exportWorkZtfaEve`,
          exportList: '/sjxmzygl/sjWorkZtfaEve/exportWorkZtfaEve',
          submit: '/sjxmzygl/sjWorkUsers/submitAudit',
          approve: '/sjxmzygl/sjWorkUsers/zyApplyCommit',
          applyLog: '/sjxmzygl/sjWorkApplyLog/queryApplyLog',
        }
      }
    },
    created() {
    },
    methods: {
      modalFormOk() {
        this.loadData();
      }
    }
  }
</script>

<style scoped>

</style>